import { PartialType } from '@nestjs/mapped-types';
import { CreateUserDto } from './create-user.dto';
import { IsNotEmpty } from 'class-validator';
import { IsString } from 'class-validator';
import { Length } from 'class-validator';

//  PartialType 用来 继承 CreateUserDto 的所有属性和验证规则并设置所有属性为可选
export class UpdateUserDto extends PartialType(CreateUserDto) {
    @IsNotEmpty()
    @IsString()
    @Length(11, 11)
    phone: string;

    @IsString()
    @Length(6, 16)
    password: string;

    @IsString()
    @Length(1, 16)
    username: string;
}